package org.example.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.Date;


@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Orders implements Serializable {


    private static final long serialVersionUID = 1L; //完成序列化操作
    @TableId(type = IdType.AUTO,value = "order_id")
    private Integer order_id; // 订单ID
    @TableField(value = "user_id")
    private Integer user_id; // 用户ID
    @TableField(value = "address_id")
    private Integer address_id; // 地址ID
    @TableField(value = "order_time")
    private Date order_time; // 订单时间
    @TableField(value = "order_status")
    private Integer order_status; // 订单状态

    @TableField(exist = false)
    private Double total_price; // 订单总价
    @TableField(exist = false)
    private Product product = new Product(); // 初始化嵌套对象
    @TableField(exist = false)
    private Orderdetail orderdetail=new Orderdetail();

    @TableField(exist = false)
    private Address address=new Address();

}
